<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../src/css/reset.css" />
		<link rel="stylesheet" type="text/css" href="../../src/css/main.css" />
		<link rel="stylesheet" type="text/css" href="../../libs/leaflet/leaflet.css" />
		<script src="../../libs/leaflet/leaflet.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../libs/leaflet/leaflet.ChineseTmsProviders.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../src/data/geojson/hangzhou.js"></script>
    <script src="../../src/data/geojson/xiaoshan.js"></script>
	</head>
	<body>
		<div id="map"></div>
		<script type="text/javascript"  id="my_script">
			let map = L.map('map', {
				center: [30.444721222054795, 120.224873962402], // leaflet 所有坐标都是纬度在前,经度在后的
				zoom: 9
			})
			
			// 地图依赖于leaflet.ChineseTmsProviders.js  他提供4326坐标系的天地图,高德地图等
			let baseLayer = L.tileLayer.chinaProvider('TianDiTu.Normal.Map', {
				maxZoom: 18,
				minZoom: 10
			})
			map.addLayer(baseLayer)
			let labelLayer = L.tileLayer.chinaProvider('TianDiTu.Normal.Annotion', {
				maxZoom: 18,
				minZoom: 10
			})
			map.addLayer(labelLayer)

      const hangzhouLayer = L.geoJSON(hangzhou, {
        style: function (feature) {
          return { color: 'green' };
        }
      }).addTo(map);
      const xiaoshanLayer = L.geoJSON(xiaoshan, {
        style: function (feature) {
          return { color: 'red' };
        }
      }).addTo(map);
      hangzhouLayer.on("click", function () {
        console.log("hangzhou")
      })
      xiaoshanLayer.on("click", function () {
        console.log("xiaoshan")
      })
		</script>
	</body>
</html>
